package com.bwie.controller;

import com.bwie.service.UserService;
import com.bwie.utils.R;
import com.bwie.vo.LoginForm;
import com.bwie.vo.PageInfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description:
 *
 * @Author chentong
 * @Create 2025/4/24 8:18
 * @Version 1.0
 */
@RestController
@RequestMapping("/user/user")
@Api(tags = "管理员登录")
public class UserController {

    @Autowired
    UserService userService;

    /**
     * 管理员登录
     * @param loginForm
     * @return
     */
    @ApiOperation(value = "管理员登录")
    @PostMapping("/adminLogin")
    public R adminLogin(@RequestBody LoginForm loginForm){
        return userService.adminLogin(loginForm);
    }

    /**
     * 用户分页列表
     * @param pageInfoVo
     * @return
     */
    @ApiOperation(value = "用户分页列表")
    @PostMapping("/userList")
    public R userList(@RequestBody PageInfoVo pageInfoVo){
       return userService.userList(pageInfoVo);
    }
}
